package com.rose.springbootgeneratefile.config;

import java.util.regex.Pattern;

public class IgnoredColumnPattern {
    private String patternRegex;
    private Pattern pattern;
//    private List<IgnoredColumnException> exceptions = new ArrayList<IgnoredColumnException>();

    public IgnoredColumnPattern(String patternRegex) {
        this.patternRegex = patternRegex;
        pattern = Pattern.compile(patternRegex);
    }
//
//    public void addException(IgnoredColumnException exception) {
//        exceptions.add(exception);
//    }

    public boolean matches(String columnName) {
        boolean matches = pattern.matcher(columnName).matches();

        if (matches) {
//            for (IgnoredColumnException exception : exceptions) {
//                if (exception.matches(columnName)) {
//                    matches = false;
//                    break;
//                }
//            }
        }

        return matches;
    }
}
